package com.xinyue.sparkle.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.xinyue.sparkle.bean.User;
import com.xinyue.sparkle.dao.UserDao;
import com.xinyue.sparkle.service.UserService;

@Service
@Transactional
public class UserServiceImpl implements UserService{
	
	@Autowired
	UserDao dao;

	public void save(User user) {
		dao.save(user);
	}

	public void update(User user) {
		dao.update(user);
	}

	public void saveOrUpdate(User user) {
		dao.saveOrUpdate(user);
	}

	public void delete(User user) {
		dao.delete(user);
	}

	public void rollBack(User user) {
		dao.delete(user);
		dao.save(user);
		dao.update(user);
	}

	public List<User> queryUser() {
		return null;
	}
}
